<div ng-app="accountApp" ng-controller="changepasswordController">
    <div class="mainbox col-md-7 col-md-offset-2 col-sm-8 col-sm-offset-2">
        <?php if($message): ?>
        <div class="alert <?php print $success ? 'alert-success' : 'alert-danger';?> alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <?php print $message; ?>
        </div>       
        <?php endif; ?>
        <form action="<?php print base_url() . 'user/account/' . $param  ;?>" ng-submit="changepasswordIndexProcess(changePasswordForm)"  method="post" id="changePasswordForm" name="changePasswordForm" class="form-horizontal" role="form" novalidate>   
            <div class="form-group" ng-class="{ 'has-error' : changePasswordForm.password_old.$error.required && submitted || changePasswordForm.password_old.$error.minlength && submitted}">
                <label for="password_old" class="col-md-3">Mật khẩu cũ</label>
                <div class="col-md-9">
                    <input type="password" class="form-control" name="password_old" value="" ng-model="changepassword.password_old" ng-minlength="6" required>
                    <p ng-show="submitted && changePasswordForm.password_old.$error.required" class="help-block">Mật khẩu không được để trống.</p> 
                    <p ng-show="submitted && changePasswordForm.password_old.$error.minlength" class="help-block">Mật khẩu quá ngắn (tối thiểu là 6 kí tự).</p> 
                    <p ng-show="submitted && changePasswordForm.$error.fail" class="help-block">Mật khẩu cũ không khớp.</p>             
                </div>
            </div>
            <div class="form-group" ng-class="{ 'has-error' : changePasswordForm.password_new.$error.required && submitted || submitted && changePasswordForm.$error.password_new || changePasswordForm.password_new.$error.minlength && submitted}">
                <label for="password_new" class="col-md-3">Mật khẩu mới</label>
                 <div class="col-md-9">
                    <input id="changepassword-email" type="password" class="form-control"  name="password_new" value="" ng-model="changepassword.password_new" ng-minlength="6" required placeholder="" >       
                    <p ng-show="submitted && changePasswordForm.password_new.$error.required" class="help-block">Mật khẩu không được để trống.</p> 
                    <p ng-show="submitted && changePasswordForm.password_new.$error.minlength" class="help-block">Mật khẩu quá ngắn (tối thiểu là 6 kí tự).</p> 
                </div>                                                             
            </div>
            <div class="form-group" ng-class="{ 'has-error' : changePasswordForm.password_new_confirm.$error.required && submitted || submitted && changePasswordForm.password_new_confirm.$error.match}">
                <label for="password_new_confirm" class="col-md-3">Xác nhận mật khẩu mới</label>
                <div class="col-md-9">
                    <input id="changepassword-email" type="password" class="form-control"  name="password_new_confirm" value="" ng-model="changepassword.password_new_confirm"  data-match="changepassword.password_new" required placeholder="" >       
                    <p ng-show="submitted && changePasswordForm.password_new_confirm.$error.required" class="help-block">Mật khẩu xác nhận không được để trống.</p>
                    <p ng-show="submitted && changePasswordForm.password_new_confirm.$error.match" class="help-block">Mật khẩu không khớp.</p>
                </div>                                                             
            </div>
            <div style="margin-top:10px" class="form-group">                
                <div class="col-sm-12 controls">
                    <div class="form-group">                                                         
                        <div class="col-md-offset-3 col-md-9">
                            <button ng-disabled="loadingTracker.active()" data-ng-click="changePasswordProcess(changePasswordForm)" id="btn-signup" type="submit" class="btn btn-info" data-style="zoom-in">
                                <span class="ladda-label">Lưu lại</span>                                               
                            </button>
                            <span ng-show="loadingTracker.active()" id="ajax-loading" class="ajax-loading margin-9"></span>
                        </div>
                    </div>
                </div>
            </div>
        </form>     
    </div> 
</div>